﻿using Eleven.BreakAway.Model;
using System.Data.Entity.ModelConfiguration;

namespace Eleven.BreakAway.DataAccess
{
    class DestinationConfiguration : EntityTypeConfiguration<Destination>
    {
        public DestinationConfiguration()
        {
            Property(d => d.Name).IsRequired().HasMaxLength(200);
            Property(d => d.Description).HasMaxLength(500);
            Property(d => d.Photo).HasColumnType("image");

            HasMany(d => d.Lodgings).WithRequired(l => l.Destination);
        }
    }
}
